'use strict';

const Controller = require('./baseController');

class DatabaseController extends Controller {
  constructor(ctx, name) {
    super(ctx);
    this.name = name;
  }
  async create() {
    const { service, name, ctx } = this;
    await this.result(
      service.mongoose.create({
        name,
        model: ctx.request.body,
      })
    );
  }
}
module.exports = DatabaseController;
